package com.album.task;



import android.content.Context;

import com.album.bean.UserInfo;
import com.album.http.HttpRequest;
import com.album.utils.Config;
/**
 * 修改用户资料
 * @author Rome
 *
 */
public class ModifyUserInfoTask extends Task{
	private String TAG = "ModifyUserInfoTask";
	private Context ctx;
	private ICallBack callBack;
	private UserInfo userInfo;
	
	public ModifyUserInfoTask(Context ctx,UserInfo userInfo,ICallBack resTask){
		this.ctx = ctx;
		this.callBack = resTask;
		this.userInfo = userInfo;
	}

	public String setRequest(){
		String strUrl =Config.TyHttp + Config.TyUserHttp+
		"modifuser?nickname="+userInfo.getNick()
		+"&passport="+userInfo.getPassport()
		+"&mobile="+userInfo.getMobile()
		+"&pause="+userInfo.getPause()
		+"&itvid="+userInfo.getItvId()
		+"&gander="+userInfo.getGender();
		String jsonString = HttpRequest.sendDataPost(ctx,strUrl, null,callBack);
		return jsonString;
	}
	@Override
	public void doTask(Task thread){
		Thread t = new Thread(thread);
		t.start();
	}
	@Override
	public void run() {
		//网络任务
		try {
			String strRsp = setRequest();
			callBack.CallBack(strRsp);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}


